Added method for counting monthly purchases. Made little refactoring.