fixed seg faul - pushed attentuate variables to heap