Refactored code

added some header info and changed function names to start with target
component