stopped using deprecated methods, fixed formatting and comments