You should use a library that does this ... if this library already exists