Working
Cleaned up duplication a bit