moved functionality to maze