Fixed deprecated things, added main reading stdin