Cleaned up pocket_detect code

Signed-off-by: torrented <wallace.ryan10@gmail.com>