randomizing g and a
prettifying