Implemented everything but some and prime function