Quick clean-up. Will re-write in the future.