changed to now take input from the port