Added GPL license, fixed bug when reading from stdin