move most functions inside Board class. Will make it easier to manage