rough working implementation of mario