started implementation of king capture functions, contains some bugs