changed input loop slightly and started adding the assign function..