adding uncommited changes. Made the code smaller.