Utility code from Red Alert Robotics, made available for everyone!