Solving 12,13,14 and updating libraries to more ruby-ish style