Works for 1.5.2. Need to port to mac and update for 1.6.4