Updated for Java7 including typing all data structures