made code more idiomatic
cleaned up code, performance enhancements
enhanced speed