Proprified the code a bit