Implemented parsing of loops