Fixed #1, added code