beautified my code...slightly