Added function declarations and unit struct