cleaned up portnes script