Adding comments and correct frame len check

Signed-off-by: Olli Vanhoja <olli.vanhoja@gmail.com>