fixed tile class to be nicer to work with
wish i tested first
main file