Fixed bug in move generation and made finished work