Changed some logic and added a simpler input