Added part of main script as separate script for testing.