Updated with fixes and variable message size