Cleaned code. Added comments. Added nice printing.