made minor changes
added my own simple implementation