improved naming, made compatibile with older rubies
add some docs
add some specs for invalid input
Simplified logic by allowing the endpoint characters to change temporarily