Currying is a better and nicer way of doing this, thanks for the suggestion!