Reformated code. Ommited main() return. Added comments.