Finished implementation and added rules