Adding extra stuff

Functions now check if its legal