started making OO version of js file