added phplot library, some cleanup, etc