Refactored a little. Allows you to use up, down, up+left, up+right, down+left and down+right. Added comments.