pretty bad implementation example, try MainTest to see result