updated var names, added methods, fixed indenting