Simplified and modified to work as a simlink