implemented input properly