working placement code - not cleaned up
source formatting