Finalised version for challenge.