Fixed some incorrect implementations of the functions to verify conditions of the puzzle