added more control flow stuff