switched back to the use for prototype function call, because it takes up less memory than putting it inside of the class