Polished a little due to lack of time.