Rewrote to get rid of ugly converter