function PLC_main(params_in::Dict{String}{Float64},options_int_in::Dict{String}{Int64},options_float_in::Dict{String}{Float64},fixed_grid::Array{Float64,2}=zeros(1,1),fixed_w::Array{Float64,1}=ones(1))

# Updated 2018-10-25

# Inputs : params_in : model parameters
#          options_int_in : solutions options (integers)
#          options_float_in : solutions options (floats)

#outputs
#=
-theta_out: final solution theta
-theta_mat: thetas at every k-loop step
-time_out: Time of the PLC Solution
-flag_mat: PLC Solution flags, 1=clustering error, 2=Non-cconvergence in solution
=#

sig_z  = params_in["sig_z"];
sig_g  = params_in["sig_g"];
sig_r  = params_in["sig_r"];
sig_d  = params_in["sig_d"];

Tsim = options_int_in["Tsim"];
skip1 = options_int_in["skip"];
Tdrop = options_int_in["Tdrop"];

# Initial Guess

# Solve log-linearized model

gx,hx=solve_sgu(params_in)

gx_temp1=vec(gx[3,[6 3 4 5 1 2]])
gx_temp2=vec(gx[1,[6 3 4 5 1 2]])
hx_temp=vec(hx[1,[6 3 4 5 1 2]])

# Initial guesses for theta

theta0_pi_1 = append!([0.0], gx_temp1);
theta0_yy_1 = append!([0.0], hx_temp);
theta0_cc_1 = append!([0.0], gx_temp2);

# Initial guess for free coefficients in ZLB regime

a13_0 = theta0_pi_1[end]*0.5;
b13_0 = theta0_yy_1[end]*0.5;
c13_0 = theta0_cc_1[end]*-0.5;

# Fix Random Seed and draw shocks for simulation
Random.seed!(options_int_in["seed"]);

# Draw fresh shocks


shocks_use=Dict{String}{Array{Float64,1}}("eg"=>sig_g*rand(Normal(),Tsim*skip1+1+Tdrop), "er" => sig_r*rand(Normal(),Tsim*skip1+1+Tdrop), "ez" => sig_z*rand(Normal(),Tsim*skip1+1+Tdrop), "ed" => sig_d*rand(Normal(),Tsim*skip1+1+Tdrop));

#=
A=readdlm("shocks.csv",',')
shocks_use["eg"]=A[:,1].*sig_g
shocks_use["er"]=A[:,2].*sig_r
shocks_use["ez"]=A[:,3].*sig_z
shocks_use["ed"]=A[:,4].*sig_d
=#
# Collect initial guess (21 unconstrained + 3 constrained)
theta_in = [theta0_pi_1[1:7]; theta0_yy_1[1:7]; theta0_cc_1[1:7];a13_0;b13_0;c13_0];

#--------------------------------------------------------------------------
#                         Call Model Solutions
#--------------------------------------------------------------------------


time_ini=time_ns()
theta_out_24,theta_mat,time_mat,flag_mat,out_x,out_res,out_conv,out_L,out_res1,GMM,save_R_GH,save_R_MONO,save_distJ,save_sizeJ_GH,save_GH_ZLB,save_MONO_ZLB= PLC_solve(params_in,shocks_use,theta_in,options_int_in,options_float_in,fixed_grid,fixed_w);
time_tot=signed(time_ns()-time_ini)/1000000000;

theta_out=zeros(16)

theta_out[1:14]=theta_out_24[1:14]
theta_out[15:16]=theta_out_24[22:23]

return theta_out,time_tot,flag_mat,GMM,theta_mat,out_res,out_x,out_conv,save_R_GH,save_R_MONO,save_distJ,save_sizeJ_GH,save_GH_ZLB,save_MONO_ZLB

end
