Added label checking, loop functionaliy