Code now minimal but functional