Moved declarations to the top

Signed-off-by: Levi Gross <levi@levigross.com>