now working as standalone program