made the code proper