Added preview section
Renamed functions and use function declaration