Refactored sim_a.R, modified pcout2.R to comply with GOOGLE R Style Guide