Use a library for that.