added links
cleaned up code