Correctness check implemented. Need to clean up